package com.tiancheng.trade.settlement.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 *order action type
 * @author kellen
 * @date 2024/3/27
 */
@Getter
@AllArgsConstructor
public enum OrderActionTypeEnum implements BaseEnum<String> {

	create("create", "创建订单"),
	pay("pay", "支付成功"),
	close("close", "取消订单"),
	refund("refund", "退款成功"),
	;

	private String code;
	private String desc;

	public static String getDesc(String code) {
		OrderActionTypeEnum[] businessModeEnums = values();
		for (OrderActionTypeEnum statusEnum : businessModeEnums) {
			if (statusEnum.code().equals(code)) {
				return statusEnum.desc();
			}
		}
		return null;
	}

	public String code() {
		return this.code;
	}

	public String desc() {
		return this.desc;
	}
}
